package rmaqlc31.basic;

public class J06_PatternsV1 {

	public static void main(String[] args) {
		// 반복문을 이용해서 다양한 패턴 출력하기
		// 패턴1 - 테스트1
		
		int i = 1;
		while(i<=6){
			System.out.print(i+" ");
			++i;
		}
		System.out.println();
		
		i = 1;
		int j = 1;
		while(j<=6){			// 행 row
			i = 1;				// 열 col
			while(i<=6){
				System.out.print(i+" ");
				++i;
			}
			System.out.println();
			++j;
		}
		
		i = 1;
		j = 1;
		while(j<=6){			// 행 row
			i = 1;				// 열 col
			while(i<=j){
				System.out.print(i+" ");
				++i;
			}
			System.out.println();
			++j;
		}
		
		System.out.println("\n");
		
		i = 1;
		while(i<=3){
			System.out.print(i+" ");
			++i;
		}
		System.out.println("\n");
		
		
		
		i = 1;
		j = 6;
		while(j>=1){			// 행 row
			i = 1;				// 열 col
			while(i<=j){
				System.out.print(i+" ");
				++i;
			}
			System.out.println();
			--j;
		}
		
		System.out.println("\n");
		
		i = 1;
		while(i<=6){
			if(i!=6)
			System.out.print("  ");
			else
				System.out.println(i);
			++i;
		}
		System.out.println("-----------------------");
		
		
		
		i = 6;
		j = 1;
		while(j<=6){
			
			i = 6;
			while(i>=1){
				if(i>j)
					System.out.print("  ");
				else
					System.out.print(i+" ");
				--i;
			}
			System.out.println();
			++j;
			
		}
		System.out.println("--------------");
		
		i = 1;
		j = 1;
		
		while(j<=6){
			i = 1;
			while(i<=6){
				if(i<j)
					System.out.print("  ");
				
				else
					System.out.print(i-j+1+" ");
				++i;
				
			}
			++j;
			System.out.println();
		}
		System.out.println("--------------");
		
		for(int b=1;b<=6;++b){
			for(int a=1;a<=6;++a){
				if(a<b)
					System.out.print("  ");
				else
					System.out.print(a-(b-1)+" ");
			}
			System.out.println();
		}
		for(int m=1;m<=6;++m){
			for(int k=1;k<=6;++k){
				if(k>=m)
					System.out.print(k-(m-1)+" ");
				else
					System.out.print("  ");
			}
			System.out.println();
		}
	}

}
